﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace MVC.Common
{
    public class DepartmentDTO
    {
        public virtual int DeptId { get; set; }

        public virtual string Name { get; set; }

        public virtual IList<EmployeeDTO> Employees { get; set; }
    }

    public class DepartmentMap : ClassMap<DepartmentDTO>
    {
        public DepartmentMap()
        {
            Table("Department");
            Id(dept => dept.DeptId).Column("DeptId");
            Map(dept => dept.Name, "Name");

            HasMany(dept => dept.Employees).KeyColumn("DeptId").Inverse();
        }
    }
}
